﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShuiBiaoXXWH.aspx.cs" Inherits="Web.Pages.YongShui.YongHuGL.ShuiBiaoXXWH" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../../../JS/jquery.js"></script>
    <script type="text/javascript">
        function keyEnter(index) {
            var controls = new Array();
            controls[0] = document.getElementById("cmbIType_I");
            controls[1] = document.getElementById("cmbXingZhengQu_I");
            controls[2] = document.getElementById("txtBiaoCeH_I");
            controls[3] = document.getElementById("txtShuiBiaoHM_I");
            controls[4] = document.getElementById("txtShuiBiaoDZ_I");
            controls[5] = document.getElementById("txtBiaoXing_I");
            controls[6] = document.getElementById("txtKouJing_I");
            controls[7] = document.getElementById("txtZhuangBiaoRQ_I");
            var key = event.keyCode;
            if (key == 13) {
                index = index + 1;
                if (index == controls.length) {
                    index = 0;
                }
                controls[index].focus();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <div class="tabletitle1" align="center">
            水表信息维护
        </div>
        <div style="width: 99.8%;">
            <table style="width:100%">
                <tr>
                    <td>
                         <asp:UpdatePanel runat="server" ID="upSearch" >
                <ContentTemplate>
                    <div style="padding-left: 20px;">
                        <table>
                            <tr>
                                <td>水表号：
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtConShuiBiaoH" runat="server" Width="170px">
                                        <ClientSideEvents KeyPress="function(s,e){var key = event.keyCode;
                                        if( key==13){$('#btnSearch').click();}}" />
                                    </dx:ASPxTextBox>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="btnSearch" runat="server" Text="查找" UseSubmitBehavior="false" OnClick="btnSearch_Click">
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div>
                        <div style="float: left; width: 50%;">
                            <fieldset style="border: 1px solid  cornflowerblue">
                                <legend style="font-weight: bold">水表列表</legend>

                                <dx:ASPxGridView ID="gvList" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Theme="Aqua1" Width="100%"
                                    OnFocusedRowChanged="gv_FocusedRowChanged" EnableCallBacks="false">
                                    <Columns>
                                        <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="水表号" Width="15%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="S_DIZHI" Caption="水表地址">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Width="35px">
                                            <DataItemTemplate>
                                                <asp:LinkButton ID="lnbModify" runat="server" CausesValidation="false" Text="修改"
                                                    CommandArgument='<%#Eval("ID")%>' OnCommand="lnbModify_Command"></asp:LinkButton>
                                            </DataItemTemplate>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Width="35px">
                                            <DataItemTemplate>
                                                <asp:LinkButton ID="lnbDel" runat="server" CausesValidation="false" Text="删除" CommandArgument='<%#Eval("ID")%>' OnCommand="lnbDel_Command"></asp:LinkButton>
                                            </DataItemTemplate>
                                        </dx:GridViewDataTextColumn>
                                    </Columns>
                                    <SettingsBehavior AllowFocusedRow="True" ColumnResizeMode="Control"  ProcessFocusedRowChangedOnServer="True" />
                                    <Settings VerticalScrollableHeight="400" VerticalScrollBarMode="Auto" />
                                </dx:ASPxGridView>
                                <div style="text-align: right;">
                                    <asp:Panel ID="panListBtns" runat="server">
                                        <table align="right">
                                            <tr>
                                                <td>
                                                    <dx:ASPxButton ID="btnClear" runat="server" Text="清空" UseSubmitBehavior="false" Visible="true" OnClick="btnClear_Click">
                                                    </dx:ASPxButton>
                                                </td>
                                                <td>
                                                    <dx:ASPxButton ID="btnHoldSelected" runat="server" Text="选中保留" Width="80" UseSubmitBehavior="false" Visible="true" OnClick="btnHoldSelected_Click">
                                                    </dx:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </div>
                            </fieldset>
                        </div>
                        <div style="float: left; width: 50%;">
                            <fieldset style="border: 1px solid  cornflowerblue">
                                <legend style="font-weight: bold">水表资料</legend>

                                <asp:Panel ID="panEdit" runat="server">
                                    <table style="width: 100%">
                                        <tr>
                                            <td style="text-align: right; width:150px">水表编号：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtShuiBiaoBH" runat="server" Width="100%">
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">用户号：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtYongHuH" runat="server" Width="100%">
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">用户名：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtYongHuM" runat="server" Width="100%">
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">水表类型：
                                            </td>
                                            <td>
                                                <dx:ASPxComboBox ID="cmbIType" runat="server" ValueType="System.String" Width="50%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(0);}" />
                                                </dx:ASPxComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">行政区块：
                                            </td>
                                            <td>
                                                <dx:ASPxComboBox ID="cmbXingZhengQu" runat="server" ValueType="System.String" Width="50%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(1);}" />
                                                </dx:ASPxComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">表册号：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtBiaoCeH" runat="server" Width="100%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(2);}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">水表户名：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtShuiBiaoHM" runat="server" Width="100%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(3);}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">水表地址：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtShuiBiaoDZ" runat="server" Width="100%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(4);}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">表型：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtBiaoXing" runat="server" Width="100%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(5);}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">口径：
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtKouJing" runat="server" Width="100%">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(6);}" />
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;">装表日期：
                                            </td>
                                            <td>
                                                <dx:ASPxDateEdit ID="txtZhuangBiaoRQ" runat="server" Width="50%" CalendarProperties-ClearButtonText="清除" CalendarProperties-TodayButtonText="今天">
                                                    <ClientSideEvents KeyPress="function(s,e){keyEnter(7);}" />
                                                </dx:ASPxDateEdit>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>

                            </fieldset>

                        </div>
                    </div>
                    <div style="text-align: right;">                        
                        <asp:UpdatePanel runat="server" ID="upBtns" UpdateMode="Conditional">
                            <ContentTemplate>
                                <dx:ASPxButton ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" UseSubmitBehavior="false" Visible="true">
                                    <ClientSideEvents Click="function(s, e) {
	                                               if (ASPxClientEdit.ValidateGroup('group')) {                 
                                                                   e.processOnServer = true;             
                                                                } 
                                                                else 
                                                                { 
                                                                   e.processOnServer = false; 
                                                                }
                                                    }" />
                                </dx:ASPxButton>
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="放弃" OnClick="btnCancel_Click" UseSubmitBehavior="false" Visible="true">
                                </dx:ASPxButton>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td><hr /></td>
                </tr>
            </table>          
            
        </div>
    </form>
</body>
</html>






